#include <cstdio>
#include <string>
#include <cstring>
#include <algorithm>
#include <iostream>
using namespace std;
int main(void){
    int t;
    string s;
    scanf("%d",&t);
    getchar();
    while(t--){
        int f=0;
        getline(cin,s);
        int n=s.size();
        if(s[0]=='_'|| s[0]>='a' && s[0]<='z' || s[0]>='A' && s[0]<='Z'){
            for(int i=1;i<n;i++){
                if(s[i]=='_' || s[i]>='0' && s[i]<='9' || s[i]>='a' && s[i]<='z' || s[i]>='A' && s[i]<='Z'){
                    f++;
                }
            }
        }
        if(f==n-1){
            printf("yes\n");
        }
        else{
            printf("no\n");
        }
    }
    return 0;
}